<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let users = [
        { name: "John", surname: "Smith", id: 1 },
        { name: "Pete", surname: "Hunt", id: 2 },
        { name: "Mary", surname: "Key", id: 3 },
      ];
      let usersMapped = users.map((v) => {
        return { id: v.id, fullName: `${v.name} ${v.surname}` };
      });
      console.log(usersMapped);
      /*
      usersMapped = [
        { fullName: "John Smith", id: 1 }, ...
      ]
      */
    </script>
  </body>
</html>
